<template>
    <div class="">

      <div class="invite-header pos-rel img-green-bg">

        <div class="text-center info-price">
          <i class="img-line-gray ib"></i>
          <span>累计奖励</span>
          <i class="img-line-gray ib"></i>
        </div>


        <div class="info-reward">
          <span class="info-reward-weight">{{invite.rewordPrice}}</span>元
        </div>

        <div class="text-center" style="color : #fff">
          已成功邀请{{invite.invitedCount}}人
        </div>


      </div>

      <h5 class="invite-title text-center text-primary">邀请好友扫一扫或分享给好友</h5>
      <p class="invite-tips text-center">您和TA分别获得<span class="text-primary">{{invite.rewordPrice}}元</span>代金券</p>

      <div class="text-center">
        <div class="img-card-bg pos-rel ib">
          <span class="img-card-bg-price">{{invite.rewordPrice}}</span>
        </div>
      </div>


      <div class="text-center">
        <div class="img-er-code ib" :style="{'backgroundImage':`url(${invite.invitedQrCode})`}"></div>
      </div>


      <p class="info">
        您的朋友健身后，代金券即可到账
      </p>

    </div>
</template>
<style lang="scss" scoped>
  .invite-title{
    font-size: 16px;
    margin-top: 25px;
    letter-spacing: 4px;
  }
  .invite-tips{
    font-size: 12px;
    margin-top: 12px;
    margin-bottom: 12px;
    color: #9B9B9B;
    letter-spacing: 3px;

  }
  .info-reward{
      color: #F8E60C;
    text-align: center;
    margin-bottom: 11px;
    .info-reward-weight{
      font-size: 35px;
    }
  }

  .info-price{
    span{
      margin: 5px 0;
      color: #CEF6D4;
      letter-spacing: 3px;
    }
    padding: 18px 0;
    padding-bottom: 12px;
  }
  .info{
    color: #9B9B9B;
    font-size: 12px;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
  }

  .img-er-code{
    margin: 25px 0;
  }
</style>
<script>
    import Util from "util";
    import API from "api";
    import  wx from  "weixin-js-sdk";

    export default{
        data(){
            return{
              invite : {}
            }
        },
        mounted : function(){
          API.biz.getInviteDetail()
            .then(res=>{
              this.invite = res.bizData;



              wx.ready(()=>{
                   Util.WX.sharePage({
                    "desc": `${this.invite.userName}邀请你一起来Vii健身`,
                    "title": `接受邀请后，你和TA分别获得${this.invite.rewordPrice}元代金券`,
                    link: `http://${window.getAbsHost()}/#/market/share/${this.invite.userId}`,
                    imgUrl: "http://www.7vii.cn/logo.png"
                 });
               });

            });



        },
        components:{
        }
    }
</script>
